maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
pkgname=gallery-dl
pkgver=1.27.6
pkgrel=0
pkgdesc="CLI tool to download image galleries"
url="https://github.com/mikf/gallery-dl"
arch="noarch"
license="GPL-2.0-or-later"
depends="py3-requests python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest yt-dlp"
subpackages="
	$pkgname-doc
	$pkgname-pyc
	$pkgname-bash-completion
	$pkgname-zsh-completion
	$pkgname-fish-completion
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/mikf/gallery-dl/archive/v$pkgver.tar.gz
	disable-type-error-test.patch
	"

build() {
	make man completion

	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	make test
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
a72c30e0c7e64fb7eb8fd2b5a8de0c0b1570b5c2fc13adaddeb0a1ce9e721b299132b2e7ebbf932155b8880283c1b3e2783e037151557a167a8664ef01cce0f8  gallery-dl-1.27.6.tar.gz
2c5117d7c15900744ead754f165933da7e7968a6adc4290e4f41284f75825354590fee09dc7d006d2f5b7ed3e755e76c5623054439dbbd4376b1edd9ed37188c  disable-type-error-test.patch
"
